home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / castools.zip / FUNCFH.ASM < prev    next >
Assembly Source File  |  1989-10-17  |  2KB  |  62 lines

  1. Include multi.inc
  2. Include model.inc
  3.  
  4. ;==============================================================================
  5. ;
  6. ;   CAS function Fh -- Get/Set Autoreceive State
  7. ;   
  8. ;   Format:
  9. ;               int CASAutoReceiveState (BYTE mode, BYTE *rings)
  10. ;   Input:
  11. ;               mode (get or set), pointer to rings variable
  12. ;   Output:
  13. ;               Returns 0 if successful or negative error code,
  14. ;               gets or sets autoreceive state.  
  15. ;==============================================================================
  16.  
  17.                 .CODE
  18. CASAutoReceiveState     PROC    arg1:BYTE, arg2:PTR BYTE  
  19.  
  20.                 push    di              ; save registers
  21.                 push    es  
  22.                 
  23.                 mov     ax,MUX          ; load multiplex number
  24.                 mov     ah,al           ; move into ah
  25.                 mov     al,0Fh          ; CAS function F
  26.                 mov     dl,arg1         ; mode
  27.                 cmp     dl,1            ; set autoreceive?
  28.                 je      SET             ; get autoreceive state
  29. GET:
  30.                 int     2Fh
  31.         IF      @DataSize               ; large and medium models
  32.                 les     di,arg2         ; pointer to rings variable
  33.         mov    es:[di],ax    ; number of rings
  34.         ELSE
  35.                 mov     di,arg2         ; small model
  36.         mov    [di],ax     ; number of rings
  37.         ENDIF
  38.                 jmp     RETVAL
  39.  
  40. SET:            
  41.         IF      @DataSize               ; large and medium models
  42.                 les     di,arg2         ; pointer to rings variable
  43.                 mov     dh,es:[di]      ; load number of rings
  44.         ELSE
  45.                 mov     di,arg2         ; small model
  46.                 mov     dh,[di]         ; load number of rings
  47.         ENDIF
  48.                 int     2Fh
  49.  
  50. RETVAL:
  51.                 cmp     ax,0            ; ax = 0?
  52.                 jle     FINISH          ; don't touch ax if <= 0  
  53.                 mov     ax,1            ; autoreceive on
  54. FINISH:
  55.                 pop     es              ; restore registers
  56.                 pop     di
  57.                 ret
  58. CASAutoReceiveState     endp
  59.      
  60.                 END
  61.                 
  62.